package com.blog.aop;

 
import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.blog.model.UserPoJo;

 
//适配器模式?
class LoginLocalThread implements Filter{
	
	public static ThreadLocal<UserPoJo> lt=new ThreadLocal<UserPoJo>();
	
	public static UserPoJo getUser(){	
		return lt.get();		
	}
	
	public static void set(UserPoJo user){
		lt.set(user);
	} 
	
	public static void remove(){
		lt.remove();
	}

	public void init(FilterConfig filterConfig) throws ServletException {
		// TODO Auto-generated method stub
		
	}

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		// TODO Auto-generated method stub
		
	}

	
	public void destroy() {
		// TODO Auto-generated method stub
		
	}
	


}
 

enum enumclass{a,b,c}
 



